package com.groupbuying.payconsumer.mq;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 支付中心消息MQ配置文件
 * @Author Vincentxin
 * @Date 2019-05-10
 */
@Component
public class PayMQConfig {
    //本中心Topic
    public static  String TOPIC ;
    public static  String GROUP_ID;
    public static final String ACCESS_KEY = "LTAIkLoCSLqX7QFG";
    public static final String SECRET_KEY = "anr8xwxEFrN4Rq0Gjw5MXxELuDb12V";
    public static final String NAMESRV_ADDR = "http://onsaddr.mq-internet-access.mq-internet.aliyuncs.com:80";



    //注入对应本中心的topic
    @Value("${RocketMQ_Key.Pay.Topic}")
    private void setTOPIC(String TOPIC) {
        PayMQConfig.TOPIC = TOPIC;

    }
    //注入对应本中心的groupId
    @Value("${RocketMQ_Key.Pay.GroupId}")
    private void setGroupId(String GROUPID) {
        PayMQConfig.GROUP_ID = GROUPID;

    }

    //银盛微信支付回执tag
    public static final String TAG_YS_PAYBACK = "YSPAYBACK";
    //银盛支付宝支付回执tag
    public static final String TAG_YS_ALI_PAYBACK = "YSALIPAYBACK";
    //积分支付回执tag
    public static final String TAG_CUR_PAYBACK = "CURPAYBACK";
    //原生微信支付回执tag
    public static final String TAG_WX_PAYBACK = "WXPAYBACK";
    //原生支付宝支付回执tag
    public static final String TAG_ALI_PAYBACK = "ALIPAYBACK";
    //余额支付回执tag
    public static final String TAG_BAL_PAYBACK = "BALPAYBACK";

    public static final String TAG_ALL = "*";


    /**
     * 支付定时检测专用tag
     */
    //银盛支付定时检测支付Tag
    public static final String TAG_YS_TIMING = "YSTIMING";
    //支付宝支付定时检测支付Tag
    public static final String TAG_ALI_TIMING = "ALITIMING";
    //微信支付定时检测支付Tag
    public static final String TAG_WECHAT_TIMING = "WECHATTIMING";
    //积分支付定时检测支付Tag
    public static final String TAG_CUR_TIMING = "CURTIMING";
    //余额支付定时检测支付Tag
    public static final String TAG_BALANCE_TIMING = "BALTIMING";


    //订单中心Topic
    public static  String ORDER_TOPIC;
    @Value("${RocketMQ_Key.Order.Topic}")
    public void setOrderTopic(String ORDERTOPIC) {
        PayMQConfig.ORDER_TOPIC = ORDERTOPIC;
    }
    //修改订单状态Tag--支付成功
    public static final String ORDER_TAG_PAY = "ORDER_PAY";
    //修改商品订单状态Tag--支付成功
    public static final String ORDER_COMMODITY_TAG_PAY = "COMMODITY_PAY";

    //积分中心Topic
    public static String CURRENCY_TOPIC;
    @Value("${RocketMQ_Key.Currency.Topic}")
    public  void setCurrencyTopic(String CURRENCYTOPIC) {
        PayMQConfig.CURRENCY_TOPIC = CURRENCYTOPIC;
    }
    //积分返现增加的Tag
    public static final String CURRENCY_TAG_ADD = "CURRENCY_ADD";

    //分账中心Topic
    public static  String SETTLE_TOPIC;
    @Value("${RocketMQ_Key.Settle.Topic}")
    public void setSettleTopic(String SETTLETOPIC){
        PayMQConfig.SETTLE_TOPIC=SETTLETOPIC;
    }
    //分账中心分账Tag--开始分账
    public static final String SETTLE_TAG_SPLIT = "SETTLE_SPLIT";
    //修改商品分账中心分账Tag--开始分账
    public static final String COMMODITY_SETTLE_TAG_SPLIT = "COMMODITY_SETTLE_SPLIT";

}
